﻿using System;
using System.Net.Http;
using System.Web.Http;
using Inovout.Cloud.Data.Blob.Domain;
using Inovout.Data.Repository;
using Inovout.Web.Http;

namespace Inovout.Cloud.Storage.WebApi.Controllers
{
    public class BucketController : BaseController
    {
        public BucketController(IRepository<Directory> dir, IRepository<File> file)
        {
        }
        [Route("v1/b")]
        public string Get()
        {
            var directoryRepository = base.GetService<IRepository<Directory>>();
            var fileRepository = base.GetService<IRepository<File>>();
               
            Directory dir = new Directory("Root" + DateTime.Now.ToString()) { Path = DateTime.Now.ToString() };
            directoryRepository.Save(dir);
            var file = new File("File", dir);
           fileRepository.Save(file);
            return "hello";
        }
    }
}